imports.gi.versions.Gtk = '3.0';
const Gtk = imports.gi.Gtk

Gtk.init (null, 0);

let win = new Gtk.Window({type: Gtk.WindowType.TOPLEVEL});
win.set_border_width(10);
win.connect ("destroy", function () { Gtk.main_quit(); });
let button = new Gtk.Button({label: "Hello, world"});
button.connect('clicked', function (){ button.set_label("Bar"); });
win.add(button);
win.show_all();

Gtk.main();